package com.leetcode.partition5;

import java.util.ArrayList;
import java.util.List;

/**
 * @author `RKC`
 * @date 2021/10/13 8:46
 */
public class LC412FizzBuzz {

    public static List<String> fizzBuzz(int n) {
        List<String> answer = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            if (i % 3 == 0) {
                if (i % 5 == 0) answer.add("FizzBuzz");
                else answer.add("Fizz");
            } else if (i % 5 == 0) {
                answer.add("Buzz");
            } else {
                answer.add(String.valueOf(i));
            }
        }
        return answer;
    }

    public static void main(String[] args) {
        System.out.println(fizzBuzz(15));
    }
}
